<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>搜索测试页面</title>

<script language="javasrcipt" type="text/javascript" src="jquery-1.10.2.js"></script>
<script type="text/javascript">
        $(function(){

		          var xmlObj='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'+
				  '<root>'+
				  '<user_id>29835634</user_id>'+
				  '<client_key>13168778307a85a688a591c1164c5225</client_key>'+
				  '<session_id>i318sass9s17i7pq0jsjl9us03</session_id>'+
				  '<city_id>2419</city_id>'+
				  '<query>肥牛</query>'+
				  '<limit>0,20</limit>'+
				  '<search_type>all_normal</search_type>'+
				  '</root>';

				  var xmldata=stringToXML(xmlObj);
				  alert(xmlObj);

		          $.ajax({
						 type: "post",//使用post方法访问后台
						 processData: false,
						 contentType: "text/xml",
						 dataType: "xml",//返回xml格式的数据
						 url: "http://10.168.5.31:8080/PersonalizeRank/bi/search/goods/29835634/2419",//要访问的后台地址
						 data: xmlObj,//要发送的数据
						//complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
						success: function(msg){//msg为返回的数据，在这里做数据绑定    
							alert(msg);
						}
             
                  });
		
		
		});//jquery script


		function stringToXML(xmlData) {
		   if(window.ActiveXObject) {
			  //for IE
			  xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
			  xmlDoc.async="false";
			  xmlDoc.loadXML(xmlData);
			  return xmlDoc;
		   }
		   else if(document.implementation&&document.implementation.createDocument) {
			  //for Mozila
			  parser=new DOMParser();
			  xmlDoc=parser.parseFromString(xmlData,"text/xml");
			  return xmlDoc;
		   }
		}
</script>
</head>
<body>
 <button id=""></button><a>
 </a>
 
 <a href=""></a>
<input id="query" type="text" size="20" value="" id=""/>
 
<select id="\"  ><option value="2149">北京</option></select>

<table>
<tbody></tbody>
</table>
</body>
</html>